package com.gujiangbo.multithreadskill;

/**
 * isAlive 判断当前线程是否处于活动状态
 *
 * @author gujiangbo
 */
public class IsAlive {
    public static void main(String[] args) {
        MyThreadIsAlive myThreadIsAlive = new MyThreadIsAlive();
        System.out.println("myThreadIsAlive start before isAlive is : " + myThreadIsAlive.isAlive());
        myThreadIsAlive.start();
        System.out.println("myThreadIsAlive start end isAlive is : " + myThreadIsAlive.isAlive());
    }


}

class MyThreadIsAlive extends Thread {
    @Override
    public void run() {
        System.out.println("the thread isAlive status is : " + Thread.currentThread().isAlive());
        System.out.println("this is " + Thread.currentThread().getName() + " is running ..");
    }
}
